<!DOCTYPE html>
<html lang="en">

    <head>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <titleRegistration Form Template</title>

        <!-- CSS -->
<!--        <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500">-->
        <link rel="stylesheet" href="./Public/register/assets/bootstrap/css/bootstrap.min.css">
        <link rel="stylesheet" href="./Public/register/assets/font-awesome/css/font-awesome.min.css">
		<link rel="stylesheet" href="./Public/register/assets/css/form-elements.css">
        <link rel="stylesheet" href="./Public/register/assets/css/style.css">
		<script src="./Public/jquery-1.11.3.min.js"></script>

        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
            <!--<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>-->
            <!--<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>-->
        <![endif]-->

        <!-- Favicon and touch icons -->
        <link rel="shortcut icon" href="./Public/register/assets/ico/favicon.png">
        <link rel="apple-touch-icon-precomposed" sizes="144x144" href="./Public/register/assets/ico/apple-touch-icon-144-precomposed.png">
        <link rel="apple-touch-icon-precomposed" sizes="114x114" href="./Public/register/assets/ico/apple-touch-icon-114-precomposed.png">
        <link rel="apple-touch-icon-precomposed" sizes="72x72" href="./Public/register/assets/ico/apple-touch-icon-72-precomposed.png">
        <link rel="apple-touch-icon-precomposed" href="./Public/register/assets/ico/apple-touch-icon-57-precomposed.png">

        <style>
            .vname,.vemail{
                position: absolute;
                top:195px;
                left:440px;
            }
            .vtwo{
                position: absolute;
                top:325px;
                left:430px;
            }
        </style>

        <script>
            $(function () {
//                异步用户名是否存在
                $('input[name=username]').blur(function(){
                    var username = $(this).val();  //获得用户名
                    $.ajax({
                        type:'post',
                        url:'index.php?c=user&a=validatename',
                        data:{username:username},
                        dataType:'json',
                        success:function(data){
                            if(data.status){
                                $('.vname').html("<span style='color: red;font-weight: 600'>用户名已存在</span>");
                            }else{
                                $('.vname').html("");
                            }
                        }
                    })
                })

//                异步验证邮箱格式
                $('input[name=email]').blur(function(){
                    var email = $(this).val();  //获得邮箱
                    $.ajax({
                        type:'post',
                        url:'index.php?c=user&a=validateemail',
                        data:{email:email},
                        dataType:'json',
                        success:function(emails){
                            if(emails.status){
                                $('.vemail').html("");
                            }else{
                                $('.vemail').html("<span style='color: red;font-weight: 600'>邮箱格式错误</span>");
                            }
                        }
                    })
                })

//                异步验证两次密码输入是否一致
                $('input[name=confirmpassword]').blur(function(){
                    var confirmpassword = $(this).val();   //获得确认密码
                    var password = $('input[name=password]').val();   //获得密码
                    $.ajax({
                        type:'post',
                        url:'index.php?c=user&a=validatetwo',
                        data:{confirmpassword:confirmpassword,password:password},
                        dataType:'json',
                        success:function(two){
                            if(two.status){
                                $('.vtwo').html("");
                            }else{
                                $('.vtwo').html("<span style='color: red;font-weight: 600'>两次密码不一致</span>");
                            }
                        }
                    })
                })
            })
        </script>
    </head>

    <body style="background: url(./Public/register/assets/img/backgrounds/1.jpg);">

		<!-- Top menu -->
		<nav class="navbar navbar-inverse navbar-no-bg" role="navigation">
			<div class="container">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#top-navbar-1">
						<span class="sr-only">Toggle navigation</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<a class="navbar-brand" href="index.html">Registration Form Template</a>
				</div>
				<!-- Collect the nav links, forms, and other content for toggling -->
				<div class="collapse navbar-collapse" id="top-navbar-1">
					<ul class="nav navbar-nav navbar-right">
						<li>
							<span class="li-text">
								Put some text or
							</span> 
							<a href="#"><strong>links</strong></a> 
							<span class="li-text">
								here, or some icons: 
							</span> 
							<span class="li-social">
								<a href="#"><i class="fa fa-facebook"></i></a> 
								<a href="#"><i class="fa fa-twitter"></i></a> 
								<a href="#"><i class="fa fa-envelope"></i></a> 
								<a href="#"><i class="fa fa-skype"></i></a>
							</span>
						</li>
					</ul>
				</div>
			</div>
		</nav>

        <!-- Top content -->
        <div class="top-content">
        	
            <div class="inner-bg">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-8 col-sm-offset-2 text">
                            <h1><strong>Bootstrap</strong>  Registration Form</h1>
                            <div class="description">
                            	<p>
	                            	This is a free responsive multi-step registration form .
                            	</p>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6 col-sm-offset-3 form-box">
                        	
                        	<form role="form" action="" method="post" class="registration-form">
                        		
                        		<fieldset>
		                        	<div class="form-top">
		                        		<div class="form-top-left">
		                        			<h3>Step 1 / 2</h3>
		                            		<p>Tell us who you are:</p>
		                        		</div>
		                        		<div class="form-top-right">
		                        			<i class="fa fa-user"></i>
		                        		</div>
		                            </div>
		                            <div class="form-bottom">
				                    	<div class="form-group">
				                    		<label class="sr-only" for="form-first-name">username</label>
				                        	<input type="text" name="username" placeholder="username..." class="form-first-name form-control" id="form-first-name">
				                            <div class="vname"></div>
                                        </div>
				                        <div class="form-group">
				                        	<label class="sr-only" for="form-about-yourself">About yourself</label>
				                        	<textarea name="introduce" placeholder="About yourself..."
				                        				class="form-about-yourself form-control" id="form-about-yourself"></textarea>
				                        </div>
				                        <button type="button" class="btn btn-next">Next</button>
				                    </div>
			                    </fieldset>
			                    
			                    <fieldset>
		                        	<div class="form-top">
		                        		<div class="form-top-left">
		                        			<h3>Step 2 / 2</h3>
		                            		<p>Set up your account:</p>
		                        		</div>
		                        		<div class="form-top-right">
		                        			<i class="fa fa-key"></i>
		                        		</div>
		                            </div>
		                            <div class="form-bottom">
				                        <div class="form-group">
				                        	<label class="sr-only" for="form-email">Email</label>
				                        	<input type="text" name="email" placeholder="Email..." class="form-email form-control" id="form-email">
                                            <div class="vemail"></div>
                                        </div>
				                        <div class="form-group">
				                    		<label class="sr-only" for="form-password">Password</label>
				                        	<input type="password" name="password" placeholder="Password..." class="form-password form-control" id="form-password">
				                        </div>
				                        <div class="form-group">
				                        	<label class="sr-only" for="form-repeat-password">Repeat password</label>
				                        	<input type="password" name="confirmpassword" placeholder="Repeat password..."
				                        				class="form-repeat-password form-control" id="form-repeat-password">
				                        <div class="vtwo"></div>
                                        </div>
				                        <button type="button" class="btn btn-previous">Previous</button>
										<button type="submit" class="btn">Sign me up!</button>
				                    </div>
			                    </fieldset>
		                    </form>
		                    
                        </div>
                    </div>
                </div>
            </div>
            
        </div>


        <!-- Javascript -->
        <script src="./Public/register/assets/js/jquery-1.11.1.min.js"></script>
        <script src="./Public/register/assets/bootstrap/js/bootstrap.min.js"></script>
        <script src="./Public/register/assets/js/jquery.backstretch.min.js"></script>
        <script src="./Public/register/assets/js/retina-1.1.0.min.js"></script>
        <script src="./Public/register/assets/js/scripts.js"></script>
        
        <!--[if lt IE 10]>
            <script src="./Public/register/assets/js/placeholder.js"></script>
        <![endif]-->

    </body>

</html>